/*
 * @Description:
 * @Version: 2.0
 * @Autor: gaowei
 * @Date: 2021-04-21 15:56:51
 * @LastEditors: gaowei
 * @LastEditTime: 2021-04-22 11:47:09
 */
let chalk = (require('chalk'));
let commander = (require('commander'));

commander.verbose = true;
function log() {
  let message = [];
  for (let _i = 0; _i < arguments.length; _i++) {
    message[_i] = arguments[_i];
  }
  if (commander.verbose) {
    console.log.apply(console, [chalk.bgCyan('日志：')].concat(message));
  }
}
exports.log = log;
function info() {
  let message = [];
  for (let _i = 0; _i < arguments.length; _i++) {
    message[_i] = arguments[_i];
  }
  console.log.apply(console, [chalk.bgBlue('通知：')].concat(message));
}
exports.info = info;
function warn() {
  let message = [];
  for (let _i = 0; _i < arguments.length; _i++) {
    message[_i] = arguments[_i];
  }
  console.log.apply(console, [chalk.bgYellow('警告：')].concat(message));
}
exports.warn = warn;
function error(message, e) {
  console.log(chalk.bgRed('错误：'), message);
  e && console.error(e);
  process.exit(-1);
}
exports.error = error;
function success() {
  let message = [];
  for (let _i = 0; _i < arguments.length; _i++) {
    message[_i] = arguments[_i];
  }
  console.log.apply(console, [chalk.bgGreen('成功：')].concat(message));
}
exports.success = success;
let timeHash = {};
function time(label) {
  timeHash[label] = Date.now();
}
exports.time = time;